package cn.flant.file;

import java.io.File;

public class FileEvent {

	public static final int FILE_CREATE = 0;
	public static final int FILE_DELETE = 1;
	public static final int FILE_MODIFY = 2;
	public static final int FILE_BACK = 3;
	private File source;
	private long oldTime = 0;
	private long newTime = 0;
	private int type = 0;

	public FileEvent(File source, int type) {
		this.source = source;
		this.type = type;
	}

	public long getOldTime() {
		return oldTime;
	}

	public void setOldTime(long oldTime) {
		this.oldTime = oldTime;
	}

	public long getNewTime() {
		return newTime;
	}

	public void setNewTime(long newTime) {
		this.newTime = newTime;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public File getSource() {
		return source;
	}

	public void setSource(File source) {
		this.source = source;
	}

	public String toString() {
		return "[file: " + source + ", type: " + type + ", oldTime: " + oldTime + ", newTime: " + newTime + "]";
	}
}
